import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AdmFileTransferVO, AdmFileTransferForm, AdmFileTransferQuery } from '@/api/general/administration/file/transfer/types';

/**
 * 查询档案移交列表
 * @param query
 * @returns {*}
 */

export const listAdmFileTransfer = (query?: AdmFileTransferQuery): AxiosPromise<AdmFileTransferVO[]> => {
  return request({
    url: '/system/admFileTransfer/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询档案移交详细
 * @param id
 */
export const getAdmFileTransfer = (id: string | number): AxiosPromise<AdmFileTransferVO> => {
  return request({
    url: '/system/admFileTransfer/' + id,
    method: 'get'
  });
};

/**
 * 新增档案移交
 * @param data
 */
export const addAdmFileTransfer = (data: AdmFileTransferForm) => {
  return request({
    url: '/system/admFileTransfer',
    method: 'post',
    data: data
  });
};

/**
 * 修改档案移交
 * @param data
 */
export const updateAdmFileTransfer = (data: AdmFileTransferForm) => {
  return request({
    url: '/system/admFileTransfer',
    method: 'put',
    data: data
  });
};

/**
 * 删除档案移交
 * @param id
 */
export const delAdmFileTransfer = (id: string | number | Array<string | number>) => {
  return request({
    url: '/system/admFileTransfer/' + id,
    method: 'delete'
  });
};
